<%--
  Created by IntelliJ IDEA.
  User: lsj
  Date: 2025/10/31
  Time: 02:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="UTF-8" %>
<html>
<head>
  <title>编辑员工</title>
  <style>
    body { font-family: Arial, sans-serif; margin: 20px; }
    .form-container { max-width: 500px; }
    .form-group { margin-bottom: 15px; }
    label { display: block; margin-bottom: 5px; }
    input[type="text"], input[type="email"], input[type="number"], input[type="date"] {
      width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 3px;
    }
    .btn { padding: 8px 15px; background: #007bff; color: white; text-decoration: none; border: none; border-radius: 3px; cursor: pointer; }
    .btn-secondary { background: #6c757d; }
  </style>
</head>
<body>
<h1>编辑员工</h1>

<div class="form-container">
  <form action="employees" method="post">
    <input type="hidden" name="action" value="update">
    <input type="hidden" name="id" value="${employee.id}">

    <div class="form-group">
      <label>姓名 *</label>
      <input type="text" name="name" value="${employee.name}" required>
    </div>

    <div class="form-group">
      <label>部门 *</label>
      <input type="text" name="department" value="${employee.department}" required>
    </div>

    <div class="form-group">
      <label>职位 *</label>
      <input type="text" name="position" value="${employee.position}" required>
    </div>

    <div class="form-group">
      <label>薪资 *</label>
      <input type="number" name="salary" step="0.01" value="${employee.salary}" required>
    </div>

    <div class="form-group">
      <label>邮箱</label>
      <input type="email" name="email" value="${employee.email}">
    </div>

    <div class="form-group">
      <label>电话</label>
      <input type="text" name="phone" value="${employee.phone}">
    </div>

    <div class="form-group">
      <label>入职日期 *</label>
      <input type="date" name="hireDate" value="${employee.hireDate}" required>
    </div>

    <div class="form-group">
      <button type="submit" class="btn">更新</button>
      <a href="employees" class="btn btn-secondary">取消</a>
    </div>
  </form>
</div>
</body>
</html>